import request from "/@/utils/request"

export function fetchList(query?: Object) {  
  return request({
    url: '/environment/substation/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj?: Object) {
  return request({
    url: '/environment/substation',
    method: 'post',
    data: obj
  })
}

export function getObj(id?: string) {
  return request({
    url: '/environment/substation/' + id,
    method: 'get'
  })
}

export function delObjs(ids?: Object) {
  return request({
    url: '/environment/substation',
    method: 'delete',
    data: ids
  })
}

export  function  listByIds(ids?: Object) {
  return  request({
    url: '/environment/substation/listByIds',
    method: 'post',
    data: ids
  })
//  const res=  
//   Promise.all([new Promise((resolve, reject) => {     
    

//   })])
//   .then(results => {
//     console.log(results)
//     return results;
//   }) // ['Hello', 'World']
//   .catch(error => console.log(error));
 
//   // return  request({
//   //   url: '/environment/substation/listByIds',
//   //   method: 'post',
//   //   data: ids
//   // })
}


export function putObj(obj?: Object) {
  return request({
    url: '/environment/substation',
    method: 'put',
    data: obj
  })
}

